package com.neuronrobotics.replicator.gui.stl;

//import javax.vecmath.Matrix3d;
//import javax.vecmath.Point3d;
//import javax.vecmath.Point3f;
//import javax.vecmath.Vector3d;
//import javax.vecmath.Vector3f;

public interface GeneralTransform3D {
	/*
	public void transform(Point3f p);
	
	public void transform(Point3d p);
	
	public void transform(Vector3f v);
	
	public void transform(Vector3d p);
	
	public double get(Matrix3d rotation, Vector3d translation);
	
	public void transform(double[] p);
	*/
	
	public enum MatrixOrder{
		COLUMN_MAJOR,
		ROW_MAJOR;
		
		/**
		 * Utility method to convert between different ordered matrices
		 * result and matrix can be the same
		 * @param result
		 * @param offsetRes
		 * @param matrix
		 * @param offsetMat
		 */
		public static void convertOrder(float[] result, int offsetRes, float[] matrix,
				int offsetMat) {
			float[] temp = new float[16];
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					temp[i * 4 + j] = matrix[j * 4 + i + offsetMat];
				}
			}
			for (int n = 0; n < 16; n++) {
				result[n + offsetRes] = temp[n];
			}

		}
		
		
		/**
		 * Utility method to convert between different ordered matrices
		 * result and matrix can be the same
		 * @param result
		 * @param offsetRes
		 * @param matrix
		 * @param offsetMat
		 
		public static void convertOrder(double[] result, int offsetRes, double[] matrix, int offsetMat) {
			double[] temp = new double[16];
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					temp[i * 4 + j] = matrix[j * 4 + i + offsetMat];
				}
			}
			for (int n = 0; n < 16; n++) {
				result[n + offsetRes] = temp[n];
			}

		}
		*/
		};
	
	public void get(float[] transform, MatrixOrder mo);
	
	public void set(float[] newTransform, MatrixOrder mo);
	
}
